/*
编写 : Hexh
时间 : 2012-9-12 14:48:01
*/
using System;
using System.Collections.Generic;
using FSBS.Core.Entity;
using FSBS.Core.Entity.IRespositories;
using HMIS.FrameWork;
using HMIS.FrameWork.DomainBase;

namespace FSBS.Facade.Impl
{
	/// <summary>
	///	 the impl of IFsbsQmStrcFacade
	/// </summary>
	public class FsbsQmStrcFacadeImpl : IFsbsQmStrcFacade
	{

		private readonly IFsbsQmStrcRepository FsbsQmStrcRepository;

		public FsbsQmStrcFacadeImpl(IFsbsQmStrcRepository FsbsQmStrcRepository)
		{
			this.FsbsQmStrcRepository = FsbsQmStrcRepository;
		}

		#region IFsbsQmStrc Entity Save,Get,Update,Delete

		public FsbsQmStrc Get(string id)
		{
			return FsbsQmStrcRepository.Get(id);
		}

		public FsbsQmStrc GetOrNull(string id)
		{
			return FsbsQmStrcRepository.GetOrNull(id);
		}

		public FsbsQmStrc Load(string id)
		{
			return FsbsQmStrcRepository.Load(id);
		}

		public void SaveOrUpdate(FsbsQmStrc entity)
		{
			this.FsbsQmStrcRepository.SaveOrUpdate(entity);
		}

		public void Delete(string id)
		{
			FsbsQmStrcRepository.Delete(id);
		}
		
		public void PhysicsDelete(string id)
		{
			FsbsQmStrcRepository.PhysicsDelete(id);
		}

		public bool IsFieldExist(string fieldName, string fieldValue, string id)
		{
			return FsbsQmStrcRepository.IsFieldExist(fieldName, fieldValue, id);
		}
		
		public bool IsFieldExistWhere(string fieldName, string fieldValue, string id, string where)
		{
			return FsbsQmStrcRepository.IsFieldExistWhere(fieldName, fieldValue, id, where);
		}
		
		#endregion
		
		#region Query 

		public IList<FsbsQmStrc> GetAll()
		{
			return FsbsQmStrcRepository.GetAll();
		}

		public IList<FsbsQmStrc> GetPlist(string qminout, string query, int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
		{
			return FsbsQmStrcRepository.GetPlist(qminout, query, start, limit, sort, dir, filters, out total);
		}
		
		#endregion
	}
}
